<?php

namespace Rpm\AdminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CommentaireType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('titre')
            ->add('contenu')
            ->add('rpm','entity', array(
	            'class' => 'Rpm\AdminBundle\Entity\Rpm',
	            'property' => 'edition',
	            'multiple' => false,
	            'required' => true
            ));
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Rpm\AdminBundle\Entity\Commentaire'
        ));
    }

    public function getName()
    {
        return 'rpm_adminbundle_commentairetype';
    }
}
